package com.mmall.dao;

import com.mmall.pojo.Category;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * 商品分类
 * @author wgt
 */
public interface CategoryMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Category record);

    int insertSelective(Category record);

    Category selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Category record);

    int updateByPrimaryKey(Category record);

    /**
     * 更新商品分类名称
     * @param id
     * @param categoryName
     * @return
     */
    int updateCategoryName(@Param("id") Integer id, @Param("categoryName")String categoryName);

    /**
     * .获取品类子节点(平级)
     * @param parentId
     * @return
     */
    List<Category> getCategoryByParentId(@Param("parentId")int parentId);

    /**
     * 获取当前分类id及递归子节点categoryId
     * @param parentId
     * @return
     */
    List<Integer> getDeepCategoryByParentId(int parentId);
}